All Questions
9 questions
5votes
2answers
506views
Select top 2 employees based on Grade and Alphabetical Order
Given a list of Employees ( name and grade). Output the names of the top 2 employees selected for a task(sorted based on grade and then alphabetically). I am using a maxHeap and override the ...
5votes
2answers
3kviews
Merge k Sorted Arrays
Please review my answer for this interview question: Merge k sorted arrays, using min heap. ...
2votes
2answers
676views
Heapsort for arbitrary ranges in Java
I plan to work on Introsort, which requires a working implementation of heap sort. Also, the heap sort implementation must be able to sort arbitrary ranges within an array, which, in turn, requires ...
0votes
1answer
166views
Heap selection sort - follow-up
See the previous and initial iteration. I got rid of Run objects and just maintain two integer arrays in the RunHeap: one for ...
5votes
1answer
727views
Heap selection sort in Java
See the next iteration. I designed and implemented this adaptive heap sort in Java. It works as follows: Copy the range to be sorted into auxiliary array \$A\$ Create an empty run heap \$H\$ Scan \$A\...
2votes
1answer
975views
Sorting an integer array using heap sort
I have written this program to sort an array using heap sort. Please review it for further improvements. ...
2votes
1answer
2kviews
Binary HeapSort and Ternary HeapSort implementation
This is my take on binary and ternary heapsort implementation for a university assignment. The code works but I wonder if there are any mistakes or things to improve. ...
1vote
1answer
158views
HeapSort Efficiency
For heap (array based) sort, we need to start at index 1, ignoring the 0th index. If I want to make a static function like ...
8votes
1answer
38kviews
Implementation of Heap Sort
Is this the correct implementation of Heap Sort using Java? How can it be improved further? ...